<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core">
  <body>
    <ui:composition template="/WEB-INF/templates/docente.xhtml">
      <ui:define name="titoloSottoSezione">
        Bandi Attivi
      </ui:define>
      
      <ui:define name="contenuto">
        <h3>Bandi Attivi:</h3>
        
        <ui:fragment rendered="#{mainBean.docente.bandiBean.numeroBandi > 0}">
        <table border="1" cellspacing="0" cellpadding="2" style="border-style: solid; border-color: #000000">
          <thead class="tableHeader">
            <tr>
              <th style="border-style: solid; border-color: #000000">N#</th>
              <th style="border-style: solid; border-color: #000000">Pubblicato il</th>
              <th style="border-style: solid; border-color: #000000">Scade il</th>
              <th style="border-style: solid; border-color: #000000"></th>
            </tr>
          </thead>
          <tbody>
            <ui:repeat value="#{mainBean.docente.bandiBean.bandi}" var="bandoBean" varStatus="info">
              <tr class="#{info.even ? 'tableRow1' : 'tableRow2'}">
                <td style="border-style: solid; border-color: #000000">#{bandoBean.bando.idBando}</td>
                <td style="border-style: solid; border-color: #000000">#{bandoBean.dataPubblicazione}</td>
                <td style="border-style: solid; border-color: #000000">#{bandoBean.dataScadenza}</td>
                <td style="border-style: solid; border-color: #000000">
                  <h:form>
                    <h:commandLink value="Dettagli" action="#{bandoBean.vediBando}"/>
                  </h:form>
                </td>
              </tr>
            </ui:repeat>
          </tbody>
        </table>
        </ui:fragment>
        
        <h3>
          <h:outputText rendered="#{mainBean.docente.bandiBean.numeroBandi == 0}" value="Non ci sono bandi attivi"/>
        </h3>        
      </ui:define>
    </ui:composition>
  </body>
</html>